﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ins = LEET.StandardModules.Instructions;
using LEET.CommonInterfaces.Compilers;
using LEET.CommonInterfaces.TestControls;


namespace Tedds_Tool.Instructions.Actions
{
    public class Rotate : Ins.Action
    {
        public Rotate(String[] args)
            : base(args)
        {

        }

        public static IAutomationActionResult StaticCall()
        {
            //TODO
            return null;
        }

        public override String RenderStaticCall()
        {
            //TODO
            return "Tedds_Tool.Instructions.Actions.Rotate.StaticCall()";
        }

        [Obsolete("This should now be replaced by RenderStaticCall", false)]
        protected override String MethodBody(AssertionSet asserts)
        {
            double theta = double.Parse(args[3].Trim());
            String pattern = "TransformPattern";
            String action = "Rotate(" + theta + ")";
            return MethodBody(pattern, action);
        }

        public override string PlainText()
        {
            string amount = args[3];
            string [] split = element.Split(',');
            return "Rotated " + split[split.Length - 1] + " to " + amount + " degrees.";
        }
    }
}
